package controllers;
 
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import models.SQLwork;
import models.SentFilter;
import models.TweetGrabber;
import play.mvc.Controller;
 
public class Tweetalyze extends Controller
{
    public static void requestSearch(String searchword) throws IOException, ParserConfigurationException, SAXException, SQLException 
    {
        ArrayList tweets = TweetGrabber.getAllInformation(searchword);
        render(tweets);
        tweets.clear();
    }
    
    public static void demoSearch(String searchword) throws IOException, ParserConfigurationException, SAXException, SQLException 
    {
        ArrayList tweets = TweetGrabber.getAllInformation(searchword);
        renderXml(tweets);
        tweets.clear();
    }
    
    public static void getNegativ() throws SQLException
    {
        renderXml(SQLwork.getNegativ());
    }
    
    public static void getPositiv() throws SQLException
    {
        renderXml(SQLwork.getPositiv());
    }
    
    public static void getNoise() throws SQLException
    {
        renderXml(SQLwork.getNoise());
    }
    
    public static void getUpdates() throws SQLException
    {
        renderXml(SQLwork.getUpdates());
    }
}